package test;

import javax.sound.midi.Soundbank;

//定义三个参数，分别是长，宽，高。定义二个方法，分别计算并输出立方体的体积和表面积
public class AreaAndVolume {
    static double height;
    static double width;
    static double length;
    public static void main(String[] args) {
        height = 5;
        width = 6;
        length = 7;
        double volume = countVolume(length, width, height);
        double area = countArea(length, width, height);
        System.out.println("体积："+volume);
        System.out.println("面积："+area);
    }
    private static double countArea(double length, double width, double height) {
        return 2 * (length * width + length * height + width * height);
    }
    private static double countVolume(double length, double width, double height) {
        return length * width * height;
    }
}
